//
//  JWCSettingCell.m
//  TableView封装
//
//  Created by Ju on 14-8-20.
//  Copyright (c) 2014年 dono. All rights reserved.
//

#import "JWCSettingCell.h"
#import "JWCSettingCellItem.h"

@implementation JWCSettingCell
{
    UISwitch *_switch;
}


- (void)setItem:(JWCSettingCellItem *)item
{
    [super setItem:item];
    
    if (item.icon) {
        self.imageView.image = [UIImage imageNamed:item.icon];
    }
    self.textLabel.text = item.title;
    if (item.style == JWCSettingCellItemStyleArraw) {
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }else if(item.style == JWCSettingCellItemStyleNone){
        self.accessoryType = UITableViewCellAccessoryNone;
    }else if(item.style == JWCSettingCellItemStyleSwitch){
        if (!_switch) {
            _switch = [[UISwitch alloc] init];
        }
        self.accessoryView = _switch;
    }
}

@end
